<!-- 课程管理-课程-编辑课程 -->
<div class="manageTitle">
	课程管理-编辑课程
</div>

<div class="content" ng-controller="editCourse">
	<div class="panel-body newExamPaper">
        <p class="titleCourse">课程信息<a href="javascript:;" ng-show="!courseInfo" ng-click="openCourseInfo();"><img src="../img/edit.png"></a></p>
	    <form class="form-horizontal" enctype="multipart/form-data" method="post" action="Course/addCourse" id="uploadCover" ng-show="courseInfo">
        	<p class="info">
        		<span class="name">课程分类</span>
    			<div class="input-group m-b">
    			    <div class="input-group-btn dropdown" dropdown="">
    			        <button type="button" class="btn btn-default" dropdown-toggle="" aria-haspopup="true"
    			        aria-expanded="false">
    			            {{courseTheme}}
                            <input type="text" value="{{courseThemeID}}" name="theme_id" class="hideInfo">
                            <input type="text" value="{{courseId}}" name="course_id" class="hideInfo">
    			            <span class="caret"></span>
    			        </button>
    			        <ul class="dropdown-menu">
    			            <li ng-repeat="item in getCourseThemeList" ng-click="selectCourseTheme(item);">
    			                <a href="javascript:;">
    			                    {{item.name}}
    			                </a>
    			            </li>
    			        </ul>
    			    </div>
    			</div>
        	</p>
	    	<p class="info">课程名称<input type="text" ng-model="name" name="course_name"></p>

	    	<div class="info clearfix">
	    		<span class="name">课程封面</span>
				<div class="coverDiv">
                    <input type="file" class="courseCover" name="cover_file" accept="images/*" id="cover">
                    <a href="javascript:;" class="cover"><img src="../img/cover.png" id="coverImg"></a>
                    <span class="coverName">{{coverName}}</span>
                    <span class="prompt">(720*407)</span>
				</div>
	    	</div>

	    	<p class="info">
	    		<span class="name">简要介绍</span>
				<textarea ng-model="introduce" name="description"></textarea>
	    	</p>

	    	<div class="btnDiv courseBtn">
                <a href="javascript:;" class="baseBtn" ng-click="sureAdd();">保存</a>
	    		<a href="javascript:;" class="baseCancelBtn" ng-click="cancelAdd();">取消</a>
	    	</div>
	    </form>
        <div class="table noPadding">
            <p class="titleCourse">课时列表</p>
            <table class="courseList">
                <thead>
                    <tr>
                        <th>课时信息</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody class="hasNoBorder">
                    <tr ng-repeat="item in videoList track by $index" class="editCourseUpload" ng-controller="videoListUpload">
                        <td>
                            <div class="sortAdd">
                                <p class="clearfix infoCourse">
                                    <label>课时名称</label>
                                    <span>{{item.name}}</span>
                                    <input type="text" ng-model="item.name">
                                </p>

                                <p class="clearfix infoCourse">
                                    <label>课时文件</label>
                                    <span>{{item.video_url}}</span>
                                    <div again-upload ng-repeat="item in courseHourList track by $index"></div>
                                </p>

                                <p class="clearfix infoCourse noPaddingBottom">
                                    <label>课时排序</label>
                                    <span>{{item.sort}}</span>
                                    <input type="number" ng-model="item.sort" min="0">
                                </p>

                                <div class="textAlignCenter">
                                    <a href="javascript:;" class="baseBtn" ng-click="sureAddCourse(item,$index,$event);" ng-if="hideBtn">确定</a>
                                </div>
                            </div>
                        </td>
                        <td class="topicHasWidth">
                            <a href="javascript:;"><img src="../img/edit.png" class="edit" ng-click="editCourseHour(item,$index,$event);"></a>
                            <a href="javascript:;"><img src="../img/delete.png" ng-click="deleteCourseHour(item,$index);"></a>
                        </td>
                    </tr>
                    <tr ng-repeat="item in courseHour track by $index" ng-controller="addCourseUpload">
                        <td>
                            <div class="sortAdd">
                                <p class="clearfix infoCourse">
                                    <label>课时名称</label>
                                    <span>{{item.name}}</span>
                                    <input type="text" ng-model="courseHourName">
                                </p>

                                <p class="clearfix infoCourse">
                                    <label>课时文件</label>
                                    <span>{{item.link}}</span>
                                    <div course-upload></div>
                                    <div course-upload ng-repeat="item in courseHourList track by $index"></div>
                                </p>

                                <p class="clearfix infoCourse noPaddingBottom">
                                    <label>课时排序</label>
                                    <span>{{item.sort}}</span>
                                    <input type="number" ng-model="courseHourSort" min="0">
                                </p>

                                <div class="textAlignCenter">
                                    <a href="javascript:;" class="baseBtn" ng-click="sureAddCourse($index,$event);" ng-if="hideBtn">确定</a>
                                </div>
                            </div>
                        </td>
                        <td class="topicHasWidth">
                            <a href="javascript:;"><img src="../img/edit.png" class="edit" ng-click="editCourseHour($index,$event);"></a>
                            <a href="javascript:;"><img src="../img/delete.png" ng-click="deleteCourseHour($index,$event);"></a>
                        </td>
                    </tr>
                    <tr ng-if="noData">
                        <td colspan="6"><img src="../img/noData.png" class="height"></td>
                    </tr>
                    <tr class="hasNoBorder">
                        <td colspan="3" class="hasNoBorder">
                            <a href="javascript:;" class="baseBtn" ng-click="addCourseUpload();">添加课时</a>
                        </td>
                    </tr>
                    <tr class="hasNoBorder">
                        <td colspan="3" class="hasNoBorder">
                            <a ui-sref="fullScore.course" class="baseBtn" style="background-color:#95A5B7;color:#f1f1f1;">保存课程</a>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
	</div>
</div>